<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\blog\model;
use think\Model;
use think\Db;
class MenusModel extends Model
{
    /*
     * 套餐查询
     * */
    public function index($where='')
    {
          
          $data=DB::name('setmeal')->where($where)->order('set_id desc')->select();
          return $data;
    }
    /*
     * 查询商品
     * */
    public function goods($where='')
    {
        if(!empty($where))
        {
            $data=DB::name('setmeal')->where($where)->order('set_id desc')->find();
        }else{
            $data=DB::name('setmeal')->where($where)->order('set_id desc')->select();
        }

        return $data;
    }
    /*
     *查询规格
     * */
    public function format($where="")
    {
           $data=DB::name('format')->where($where)->select()->toArray();
           return $data;
    }
    /*
     * 查询折扣
     * */
    public function promotion($where="")
    {
        $data=DB::name('promotion')->where($where)->select();
        return  $data;
    }
}